<?php
echo $this->Html->css(array('plugins/chosen/chosen','plugins/multiselect/multi-select','plugins/datepicker/datepicker'),null,array('inline'=>false));
echo $this->Html->script(array('plugins/chosen/chosen.jquery.min','plugins/datepicker/bootstrap-datepicker'),array('inline'=>false));
?>
<div class="row-fluid">
    <div class="span12">
        <div class="box box-color box-bordered">
            <div class="nomargin box-title">
                <h3>Listagem das Temporadas</h3>
                <div class="actions">
                    <?php echo $this->Html->link('<i class="icon-plus-sign"></i> Nova',array('controller'=>'seasons','action'=>'add'),array('class'=>'btn btn-primary','escape'=>false,'rel'=>"tooltip",'data-placement'=>"left",'data-original-title'=>"Adicionar no anime.")); ?>
                </div>
            </div>
            <div class="box-content nopadding">
                <table class="table table-hover table-nomargin dataTable table-bordered dataTable-scroll-y dataTable-scroll-x">
                    <thead>
                    <tr>
                        <th><?php echo $this->Paginator->sort('anime_id'); ?></th>
                        <th class="actions"><?php echo __('Ações'); ?></th>
                    </tr>
                    <tr class="thefilter" role="row">
                        <th rowspan="1" colspan="1">
                            <span class="filter_column filter_text">
                                <?php echo $this->Search->create('',array('class'=>'nomargin')); ?>
                                <div class="input-append no-pull span12 nomargin">
                                    <?php
                                    echo $this->Search->input('anime',array('class'=>'span8 typeahead nomargin','placeholder'=>'Nome do Anime','data-provide'=>"typeahead",'data-items'=>"4",'autocomplete'=>'off'));
                                     echo $this->Search->input('ano',array('label'=>false,'placeholder'=>'Ano','class'=>'span1','div'=>false));
                                    echo $this->Search->input('situacao',array('class'=>'span2 chosen-select','placeholder'=>'Stados do anime'));
                                    echo $this->Search->input('t_status',array('class'=>'chosen-select','style'=>'width:9.983%','placeholder'=>'Status'));
                                    ?><button class="btn" type="submit">Go!</button>
                                </div>
                                <?php echo $this->Search->end();?>
                            </span>
                        </th>
                        </th>
                        <th rowspan="1" colspan="1"></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php
                    if(!empty($seasons)):
                    foreach ($seasons as $season):
                        ?>
                        <tr class="">
                            <td>
                                <dd class='box-img pull-left'>
                                    <div class="thumbnail">
                                        <?php echo $this->Html->image('anime/photo/'.$season['Anime']['id'].'/vga_'.h($season['Anime']['photo']),array('style'=>'width:130px;'))?>
                                    </div>
                                </dd>
                                <span class="help-block span9">
                                    <dt>
                                        <?php echo $this->Html->link($season['Anime']['name'], array('controller' => 'animes', 'action' => 'view', $season['Anime']['id'])).' - '.h($season['Season']['name']); ?>
                                    </dt>
                                    <dd>
                                        Assistido:&nbsp;<?php echo h($season['Season']['dow_episodes']); ?>
                                        Total:&nbsp;<?php echo h($season['Season']['full_episodes']); ?>
                                    </dd>
                                    <dd>
                                        Ano de Lançamento:&nbsp;<?php echo h($season['Season']['release_year']); ?>
                                    </dd>
                                    <dd>
                                        <?php echo $this->Html->link($season['Situation']['name'], array('controller' => 'situations', 'action' => 'view', $season['Situation']['id'])); ?> / <?php echo $this->Html->link($season['Rating']['name'], array('controller' => 'ratings', 'action' => 'view', $season['Rating']['id'])); ?>
                                    </dd>
                                    <dd>
                                        <?php echo $this->Html->link($this->Function->Status($season['Season']['status']),'javascript:;',array('escape'=>false,'class'=>"status",'id'=>$season['Season']['id'],'data-sourse'=>$this->webroot.'seasons/','data-value'=>$season['Season']['status']))?>

                                    </dd>
                                </span>
                            </td>
                            <!--<td><?php /*echo h($season['Season']['created']); */?>&nbsp;</td>
                            <td><?php /*echo h($season['Season']['modified']); */?>&nbsp;</td>-->
                            <td style="width: 15px;">
                                <div class="btn-group-vertical">
                                    <div class="btn-group">
                                        <?php
                                        echo $this->Html->link('<i class="icon icon-edit"></i> Editar',array('controller'=>'seasons','action'=>'edit',$season['Season']['id']),array('class'=>'btn btn-inverse','escape'=>false));
                                        echo $this->Html->link('<i class="icon icon-eye-open"></i> Ver',array('controller'=>'seasons','action'=>'view',$season['Season']['id']),array('class'=>'btn btn-inverse linkModal','escape'=>false));
                                        ?>
                                    </div>
                                    <?php
                                    echo $this->Form->postLink(__('<i class="icon icon-trash"></i> Delete'), array('action' => 'delete', $season['Season']['id']), array('escape'=>false,'class'=>'btn btn-danger'), __('Deseja remover:\n%s?', $season['Season']['name']));
                                    ?>
                                </div>
                            </td>
                        </tr>
                    <?php
                    endforeach;
                    else:
                    ?>
                    <tr>
                        <td colspan="2"><span class="alert alert-info span12 nomargin"><strong>INFORMAÇÃO:&nbsp;</strong>Não foi encontrado resultado em nosso banco</span></td>
                    </tr>
                    <?php endif;?>
                    </tbody>
                </table>
                <?php echo $this->Element('_paginate')?>
            </div>
        </div>
    </div>
</div>
<?php echo $this->Element('_modalView');?>
